fix: five defects found by building a real application on 26.09.1 (release 26.09.2) - #2
Merged
Merged
Conversation
Every one reproduced by a failing test first. - cqrs: CommandProcessingException/QueryProcessingException dropped the cause's errorCode while copying its httpStatus, category and severity, so every domain fault reached the client as COMMAND_PROCESSING_ERROR and callers had nothing to branch on. BREAKING. - container: ContainerRegistrar rebound every #[Component] class unconditionally during boot(), silently discarding a binding the application had registered in register(). The failure surfaced later as an unrelated-looking autowiring error. Explicit bindings now win, matching the bean sweep's own precedence rule. BREAKING. - security/context: strict method security refused the boot of `firefly:cache` itself, so the command its own error message told you to run could never run. AppScan::regenerating() now reports that boot and the gate stands down for it. - context: a stale compiled manifest killed EagerSingletonsPass before `firefly:cache` could replace it, leaving `rm -rf bootstrap/cache/firefly` as the only recovery. Compiled artefacts are ignored while regenerating. - skeleton: `/tests export-ignore` deleted the test scaffold from every scaffolded project, so a fresh `composer create-project` fatalled on a missing Tests\CreatesApplication trait before running one assertion. Release 26.09.2.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Five defects found while building a production application (dworkers) against
26.09.1. Every one wasreproduced by a failing test first, and every one is a case where the framework's behaviour contradicted
what its own documentation or error messages said it did.
BREAKING
packages/cqrs— the wrappers now carry the cause's error code.CommandProcessingException/QueryProcessingExceptioncopied aFireflyExceptioncause'shttpStatus,categoryandseverity, then overwrote itserrorCodewith their own. Three quarters of a fault'sidentity survived the bus and the quarter clients actually branch on did not: a duplicate came back as
409 COMMAND_PROCESSING_ERROR, a missing row as404 COMMAND_PROCESSING_ERROR, a denial as403 COMMAND_PROCESSING_ERROR. Applications worked around it by catching the wrapper and rethrowinggetPrevious()in every controller that dispatched a command. A cause that is not aFireflyExceptionstill yields the generic code, so internal failures do not start leaking codes.
The Lumen capstone's own security assertion moves from
COMMAND_PROCESSING_ERRORtoACCESS_DENIEDin thisPR — that is the fix demonstrating itself.
packages/container— an explicit binding now wins over the scan.ContainerRegistrar::bindClass()rebound every#[Component]class unconditionally duringboot(), afterproviders'
register(). An application that had deliberately bound a component — the normal way to hand onea value the container cannot autowire — silently lost that binding, and the loss surfaced nowhere near its
cause: boot succeeded and the first consumer died with
Unresolvable dependency resolving [Parameter #0 [ <required> string $x ]]. This is the precedence rule the bean sweep already applied where a#[Bean]name and a component name collide.
Fixed
firefly:cachecan run on an application that has no manifests yet. Withfirefly.security.method.stricton and no compiledsecurity-methods.php,SecurityWiringProviderrefusedto boot — including for
firefly:cache, the only command that writes that file. Its own error message said"Run
php artisan firefly:cache", and that command hit the same error, so a fresh clone, a cleared cachedirectory and the first layer of an image build were unrecoverable without disabling strict mode by hand.
A stale compiled manifest no longer bricks the command that would replace it. Compiled artefacts are
treated as absent while
firefly:cacheis the running command, so acomponent.phpnaming a class that hasstopped being autowirable is ignored rather than eagerly resolved before the writer is reached.
EagerSingletonsPassalready tolerated an entry whose class no longer exists; this closes the neighbouringcase where the class exists and the manifest is out of date. Both now recover with
firefly:cacheinstead ofrm -rf bootstrap/cache/firefly.Both are one mechanism:
AppScan::regenerating().composer create-project firefly/skeletonships its test scaffold again. The skeleton's.gitattributescarried
/tests export-ignore— right for a library, wrong for a project template, because Composer honoursit when exporting into the new project. Every scaffolded application arrived with a
phpunit.xmlpointing attests, anautoload-devmappingTests\totests/, and notests/directory, so the firstvendor/bin/phpunitfatalled withTrait "Tests\CreatesApplication" not foundbefore running one assertion.Verification
vendor/bin/pestvendor/bin/phpstan analysevendor/bin/pint --testvendor/bin/deptrac analyseVersion bumped to
26.09.2with a CHANGELOG entry. The tag is deliberately not pushed:docs/publishing.mdrequires a human to confirm each irreversible step.